import * as actionTypes from '../actionTypes'
export const counterReducer=(state={num:10},action)=>{
    switch(action.type){
        case actionTypes.INCREMENT:
            return{
                ...state,
                num:state.num+action.num
            }
        case actionTypes.DECREASE:
            return{
                ...state,
                num:state.num-action.num
            }
        default:
            return state
    }
}